func void B_EarlyGamestart()
{
	MEM_Info("BOTK: EarlyGamestart: Start");
	
	RedCampHndl = new(hCCamp@);
    BlueCampHndl = new(hCCamp@);
		
	B_SetGuild(PlayerColor,PlayerGuild);
    B_SetGuild(AiColor,AiGuild);
	
	MEM_Info("BOTK: EarlyGamestart: Finished");
};

func void B_GAMESTART() {
	MEM_Info("BOTK: GAMESTART: Start");

	/* Werte Ini Optionen aus */
	var int numGold;
	
	NoNews_On      = STR_ToInt(MEM_GetGothOpt("MOD_BOTK4", "News"));
	NumFighter     = STR_ToInt(MEM_GetGothOpt("MOD_BOTK4", "NumFighter")) + 1; // 0-2, sollte aber 
	NumMage        = STR_ToInt(MEM_GetGothOpt("MOD_BOTK4", "NumMage")) + 1;    // 1-3 sein
	numGold        = STR_ToInt(MEM_GetGothOpt("MOD_BOTK4", "Startmoney")) * 10; //0-10, sollte 0-100 sein
	
	/* Aber erstmal gucken wir ob da was nicht stimmt ;) */
	if(NoNews_On<0) { NoNews_On = 0; };
	if(NoNews_On>1) { NoNews_On = 1; };
	if(NumFighter<1) { NumFighter = 1; };
	if(NumFighter>5) { NumFighter = 5; };
	if(NumMage<1) { NumMage = 1; };
	if(NumMage>3) { NumMage = 3; };
	if(numGold<  0) { numGold = 0;   };
	if(numGold>100) { numGold = 100; };

	if(!GiveRunen) {
		CreateInvItems(hero, ItRu_TeleportSeaport,1);
		CreateInvItems(hero, ItRu_TeleportFarm,1);
		CreateInvItems(hero, ItRu_TeleportPassOW,1);
		if (Map == Varus_Map)
		{
			CreateInvItems(hero, ItRu_TeleportPassNW,1);
			CreateInvItems(hero, ItRu_TeleportTaverne,1);
		};
		
		B_SetGuild(PlayerColor,PlayerGuild);
	    B_SetGuild(AiColor,AiGuild);
		B_SetGold(RED,numGold);
		B_SetGold(BLUE,numGold);
		
		B_SetWeaponLevel(RED,1);
		B_SetArmorLevel(RED,1);
		B_SetSoldierLevel(RED,1);
		B_SetMageLevel(RED,MAGE_NOVICE);
		B_SetGuardLevel(RED,1);
		
		B_SetWeaponLevel(BLUE,1);
		B_SetArmorLevel(BLUE,1);
		B_SetSoldierLevel(BLUE,1);
		B_SetMageLevel(BLUE,MAGE_NOVICE);
		B_SetGuardLevel(BLUE,1);
		
		B_SetSmithItem(RED,SCHMIED_RUESSI);
		B_SetSmithItem(BLUE,SCHMIED_RUESSI);
		
		B_SetWayPartition(RED,2);//bei 4 alle nach 1, bei 0 alle nach 2
		B_SetWayPartition(BLUE,2);//bei 4 alle nach 1, bei 0 alle nach 2
		
		B_SetAiControlled(AiColor,TRUE);
		
		GiveRunen = TRUE;
	};
	FF_ApplyOnceExt(B_PRINTSCHLEIFE,975,-1);
	FF_ApplyOnceExt(B_SKRIPT_SCHLEIFE,scriptLoopDelay,-1);
	FF_ApplyOnceExt(B_AI,1000,-1);
	FF_ApplyOnceExt(EVT_Perframe,0,-1);
	FF_ApplyOnceExt(DF_LoopFunc,1000,-1);
	
	// Soldatenspawns
	FF_ApplyExt(B_SpawnSoldier_Loop,soldierSpawnDelay/3,1);
	FF_ApplyOnceExt(B_SpawnMage_Loop,mageSpawnDelay,-1);
	FF_ApplyOnceExt(B_SpawnSkeleton_Loop,skeletonSpawnDelay,-1);
	
	FF_ApplyExt(CSMITH_S1,25000,1);
	FF_ApplyExt(INIT_PERFRAME,1000,1);
	
	if(B_GetGuild(RED)==PAL)	{ B_SetHeroFX(RED,"spellFX_ReviveHero_Pal"); };
	if(B_GetGuild(RED)==SKE)	{ B_SetHeroFX(RED,"spellFX_ReviveHero_Ske"); };
	if(B_GetGuild(RED)==DJG)	{ B_SetHeroFX(RED,"spellFX_ReviveHero_Djg"); };
	if(B_GetGuild(RED)==TMP)	{ B_SetHeroFX(RED,"spellFX_ReviveHero_Tmp"); };
	if(B_GetGuild(RED)==GRD)	{ B_SetHeroFX(RED,"spellFX_ReviveHero_Grd"); };
	
	if(B_GetGuild(BLUE)==PAL)	{ B_SetHeroFX(BLUE,"spellFX_ReviveHero_Pal"); };
	if(B_GetGuild(BLUE)==SKE)	{ B_SetHeroFX(BLUE,"spellFX_ReviveHero_Ske"); };
	if(B_GetGuild(BLUE)==DJG)	{ B_SetHeroFX(BLUE,"spellFX_ReviveHero_Djg"); };
	if(B_GetGuild(BLUE)==TMP)	{ B_SetHeroFX(BLUE,"spellFX_ReviveHero_Tmp"); };
	if(B_GetGuild(BLUE)==GRD)	{ B_SetHeroFX(BLUE,"spellFX_ReviveHero_Grd"); };
	
	MEM_Info("BOTK: GAMESTART: Finished");
};